﻿using System;
using System.Text.RegularExpressions;
using System.Windows.Forms;

namespace YaP.Forms
{
    public partial class DebugForm : Form
    {
        public DebugForm()
        {
            InitializeComponent();
        }

        public void Write2Debug(string towrite)
        {
            Regex ComposedColorExp = new Regex(@"(\d+),(\d+)");
            MatchCollection cmc = ComposedColorExp.Matches(towrite);
            foreach (Match match in cmc)
            {
               
            }
            try
            {
                colorTextBox1.Invoke((MethodInvoker) delegate { colorTextBox1.AppendText(towrite); }
                    );
            }
            catch (Exception ex)
            {
            }
        }

        private void DebugForm_Load(object sender, EventArgs e)
        {
        }

        private void richTextBox1_TextChanged(object sender, EventArgs e)
        {
            colorTextBox1.ScrollToLine(colorTextBox1.LineCount);
        }
    }
}